package com.mycompany.myapp.repository;

import com.mycompany.myapp.domain.Address;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * Spring Data  repository for the Address entity.
 */
@SuppressWarnings("unused")
@Repository
public interface AddressRepository extends JpaRepository<Address, Long> {

    @Query("select ad from Address ad where ad.id = ?1")
    Address findOneById(Long id);

    //@Query("select ad from Address ad where ad.suserId = ?1 and ad.isDefault = 1")
    Address getAddressByIsDefaultAndSuserId(Integer isDefault,Long suserId);

    List<Address> findAddressBySuser_Id(Long suserId);
}
